import { PartialType } from '@nestjs/swagger';
import { FindLimitDto, FindObj } from 'src/dto/find-limit-dto';

export class PostInfoDto {
  public id: string;
  public title: string;
  public content: string;
  public contentHtml: string;
  public summary: string;
  public coverUrl: string;
  public isRecommend: boolean;
  public status: string;
  public author: { nickname: string; id: string };
  public category: FindObj;
  public tags: FindObj[];
  public count: number;
  public likeCount: number;
}

export interface PostsRo<T> {
  list: T[];
  count: number;
}

export class QueryContentDto extends PartialType(FindLimitDto) {
  status?: 'draft' | 'publish' = 'publish';
  title?: string;
}

export class searchDto extends PartialType(QueryContentDto) {
  keyword: string;
  category: number;
  tags: number[];
}
